package com.bank.controller;

import com.alibaba.fastjson.JSON;
import com.bank.model.Assets;
import com.bank.service.InfoService;
import com.bank.service.VerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class AssetsController {

    @Autowired
    InfoService infoService;

    @RequestMapping(value = "/allAssets",method = RequestMethod.GET)
    public String getAssets(@RequestParam("uid")String uid ) {
        Map<String,Object> ret = new HashMap<>();
        ret.put("code",0);
        ret.put("msg","");
        List<Assets> list = infoService.getAllAssetsList(uid);
        ret.put("count",list.size());
        ret.put("data",list);
        return JSON.toJSONString(ret);
    }
}
